﻿using CanDichVu.FrameWork.Conrtron;
using CanDichVu.Service.Iservice;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CanDichVU.Controllers
{
    public class CategoryController : ContronllerBase
    {
        private readonly ICate _icate;

        public CategoryController(ICate icate)
        {
            this._icate = icate;
        }

        //
        // GET: /Category/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetMenuLeft(int partent)
        {
            var _listEntity = _icate.getListByParent(partent);
            return PartialView("_GetMenuLeft", _listEntity);
        }

        public ActionResult GetChuyenMucsetFooter()
        {
            var _listEntity = _icate.GetAllSetFooter();
            return PartialView("_GetChuyenMucsetFooter", _listEntity);
        }

        public ActionResult _listSubCateOnCate(int parentid,int selected)
        {
            var _listEntity = _icate.getListByParent(parentid);
            ViewBag.selectedID = selected;
            return PartialView("_listSubCateOnCate", _listEntity);
        }

    }
}
